Subject: Re: libs
From: [email-masked] (Son H. Le)
To: [email-masked] (blitz-list)
Date: Thu, 19 May 1994 10:38:34 +1000 (EST)

> > It depends on what kind of libs you're trying to add to Blitz2. Is it one
> > you're going to write, eg. ElmoreLib or converting an existing amiga library
> > (eg. triton.library). 

> > If the latter than use fdconv on any *.fd files you
> > find with the library and then use MakeDefLibs.

> Please explain (with a example perhaps?)

Well, let's take the triton.library example which I've converted myself.
In the triton10.lha archive, in the Programmer/FD directory there is a
triton_lib.fd file. In this file is the relative offset of the routines in
the library. To use the library, you need to convert this to an *.library1
Blitz lib file. This is automatically done by the supplied program fdconv.

So you install the library in your LIBS: directory, run 'fdconv
triton.library' and when prompt for a libnum, supply one that is unused
(check in libnum.bb). FDConv will automatically write a file (in this case
'triton.library1' - if the library is big enough a second 'triton.library2')
to your blitzlibs:amigalibs directory.

Now you can do a RELOAD ALL LIBS (which makes blitz2 scan all your
blitzlibs: directories and load the libs) or make a permanent quicker file
with MakeDefLibs. You should be about to call library commands now (with
trailing '_' as usual) and the command will be tokenised.

All you need to do is convert the Programmer/include/libraries/triton.h
header program and you can fully use the library with is constants and
structures. There's a program on the examples disk, converth.bb(?) that
helps you convert the header file to a blitz2 macro file, with which you
need to convert to a *.res or include with your program.

Please note, not all libraries can be converted to work with blitz2. One
such example is ReqTools library, which uses register A3-A5(?) which blitz
can't cope with as it clashs with blitz registers, I think.

Good luck!
Son Le

-- 
Son H. Le                             email: [email-masked]
          "Nothing comes from nothing, nothing ever could..."